
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>FAQ · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="FUTURE.html" />
    
    
    <link rel="prev" href="EXAMPLES.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://github.com/jeromeetienne/ar.js" target="_blank" class="custom-link">Github</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Read Me
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="CHANGELOG.html">
            
                <a href="CHANGELOG.html">
            
                    
                    CHANGELOG
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="EXAMPLES.html">
            
                <a href="EXAMPLES.html">
            
                    
                    EXAMPLES
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4" data-path="FAQ.html">
            
                <a href="FAQ.html">
            
                    
                    FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="FUTURE.html">
            
                <a href="FUTURE.html">
            
                    
                    FUTURE
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../concepts/augmented-website.html">
            
                <a href="../concepts/augmented-website.html">
            
                    
                    augmented website
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../concepts/webar-playground.html">
            
                <a href="../concepts/webar-playground.html">
            
                    
                    webar playground
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../posts/post-XX-how-to-use-arjs-with-aframe.html">
            
                <a href="../posts/post-XX-how-to-use-arjs-with-aframe.html">
            
                    
                    post-XX-how-to-use-arjs-with-aframe
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../posts/post-update.html">
            
                <a href="../posts/post-update.html">
            
                    
                    post-update
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >FAQ</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="arjs-faq">AR.js FAQ</h1>
<h2 id="how-small-can-we-print-the-markers-">How small can we print the markers ?</h2>
<p>There is no absolute. It is a ratio between the physical size of the marker, and the resolution of the camera image.
It is a tradeoff: the larger the camera image, the slower it is running.
The larger the camera image, the smaller the marker can be.</p>
<h2 id="how-to-run-arjs-locally">How to Run AR.js Locally</h2>
<p>To run AR.js locally on your computer, first clone a copy of the repository, and change to the <code>AR.js</code> folder:</p>
<pre><code>  git clone git@github.com:jeromeetienne/AR.js.git
  cd AR.js
</code></pre><p>After that, serve the files using a static http server.  I use a simple command line http server called <code>http-server</code>.
This can be installed using npm:</p>
<pre><code>  npm install -g http-server
</code></pre><p>to start the http-server, simply run:</p>
<pre><code>  http-server
</code></pre><h2 id="cant-access-user-media-error">Can&apos;t access user media error</h2>
<p>On mobile, accessing the camera using <code>getUserMedia</code> requires that you have a secure HTTPS connection to the server.  To do this, you will need to generate a certificate by running:</p>
<pre><code>  openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
</code></pre><p>This will generate two files: <code>key.pem</code> and <code>cert.pem</code>.</p>
<p>You then run the server with the <code>-S</code> to enable SSL and <code>-C</code> for your certificate files:</p>
<pre><code>  http-server -S -C cert.pem -o
</code></pre><p>Alternatively, you can deploy to <a href="https://pages.github.com/" target="_blank">github pages</a> which by default, is served using HTTPS.  This avoids having to configure a SSL server.</p>
<p>Also working from localhost, you can avoid having to use HTTPS since <a href="https://w3c.github.io/webappsec-secure-contexts/#localhost" target="_blank">localhost is assumed secured</a>.</p>
<p>Thanks to <a href="https://gist.github.com/mritzco" target="_blank">@mritzco</a> for <a href="https://gist.github.com/mritzco/18dfe13096294592d5eb53e7e1a5f63c" target="_blank">configuration directions</a>.</p>
<h1 id="which-plateform-is-supported-">Which plateform is Supported ?</h1>
<p>it works on any browser with WebRTC and WebGL.
It run on platforms: android, IOS and window mobile.</p>
<p>As experimentation, it has been on 
<a href="https://twitter.com/jerome_etienne/status/883396955400880129" target="_blank">htc vive</a> by <a href="https://twitter.com/robenghuse" target="_blank">@robenghuse</a> 
and <a href="https://twitter.com/jerome_etienne/status/856503929814831108" target="_blank">hololens</a> by <a href="https://twitter.com/evhan55" target="_blank">@evhan55</a>.
What is interested is that i didn&apos;t change a line to run on those devices. AR.js ran out of the box directly
on htv vive and Hololens, i think it is a clear proof of the web being true cross-platform.</p>
<h1 id="how-to-release-">How To Release ?</h1>
<p>This one is mainly for <a href="@jerome_etienne">me</a> to remember :)</p>
<pre><code class="lang-bash"><span class="hljs-comment"># replace REVISION to the proper version</span>
atom three.js/threex-artoolkitcontext.js package.json

<span class="hljs-comment"># Rebuild a-frame and webvr-polyfill</span>
(<span class="hljs-built_in">cd</span> aframe &amp;&amp; make minify) &amp;&amp; (<span class="hljs-built_in">cd</span> webvr-polyfill &amp;&amp; make minify)

<span class="hljs-comment"># Commit everything</span>
git add . &amp;&amp; git commit <span class="hljs-_">-a</span> -m <span class="hljs-string">&apos;Last commit before release&apos;</span>

<span class="hljs-comment"># tag the release</span>
git tag 1.0.0

<span class="hljs-comment"># push the tag on github</span>
git push origin --tags

<span class="hljs-comment"># update npm package.json</span>
npm publish

<span class="hljs-comment"># update the a-frame codepen</span>
open <span class="hljs-string">&quot;https://codepen.io/jeromeetienne/pen/mRqqzb?editors=1000#0&quot;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="EXAMPLES.html" class="navigation navigation-prev " aria-label="Previous page: EXAMPLES">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="FUTURE.html" class="navigation navigation-next " aria-label="Next page: FUTURE">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"FAQ","level":"1.4","depth":1,"next":{"title":"FUTURE","level":"1.5","depth":1,"path":"misc/FUTURE.md","ref":"misc/FUTURE.md","articles":[]},"previous":{"title":"EXAMPLES","level":"1.3","depth":1,"path":"misc/EXAMPLES.md","ref":"misc/EXAMPLES.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","anchorjs"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/jeromeetienne/ar.js/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/jeromeetienne/ar.js/tree/master/docs/"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchorjs":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sidebar":{"Github":"https://github.com/jeromeetienne/ar.js"}},"gitbook":"*","theme-default":{"styles":{"website":"gitbook/gitbook.css"}}},"file":{"path":"misc/FAQ.md","mtime":"2017-07-12T13:36:31.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-07-25T16:10:51.511Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.1.1/anchor.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-anchorjs/anchor-style.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

